/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pruebaes.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author luisfernando
 */
@Entity
@Table(name = "novedades")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Novedades.findAll", query = "SELECT n FROM Novedades n"),
    @NamedQuery(name = "Novedades.findById", query = "SELECT n FROM Novedades n WHERE n.id = :id"),
    @NamedQuery(name = "Novedades.findByNombre", query = "SELECT n FROM Novedades n WHERE n.nombre = :nombre"),
    @NamedQuery(name = "Novedades.findByProximadias", query = "SELECT n FROM Novedades n WHERE n.proximadias = :proximadias"),
    @NamedQuery(name = "Novedades.findByNovedadfinal", query = "SELECT n FROM Novedades n WHERE n.novedadfinal = :novedadfinal"),
    @NamedQuery(name = "Novedades.findByNumerointentos", query = "SELECT n FROM Novedades n WHERE n.numerointentos = :numerointentos")})
public class Novedades implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 2147483647)
    @Column(name = "nombre")
    private String nombre;
    @Column(name = "proximadias")
    private Integer proximadias;
    @Column(name = "novedadfinal")
    private Boolean novedadfinal;
    @Column(name = "numerointentos")
    private Integer numerointentos;
    @OneToMany(mappedBy = "novedad")
    private List<Trackings> trackingsList;

    public Novedades() {
    }

    public Novedades(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public Integer getProximadias() {
        return proximadias;
    }

    public void setProximadias(Integer proximadias) {
        this.proximadias = proximadias;
    }

    public Boolean getNovedadfinal() {
        return novedadfinal;
    }

    public void setNovedadfinal(Boolean novedadfinal) {
        this.novedadfinal = novedadfinal;
    }

    public Integer getNumerointentos() {
        return numerointentos;
    }

    public void setNumerointentos(Integer numerointentos) {
        this.numerointentos = numerointentos;
    }

    @XmlTransient
    public List<Trackings> getTrackingsList() {
        return trackingsList;
    }

    public void setTrackingsList(List<Trackings> trackingsList) {
        this.trackingsList = trackingsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Novedades)) {
            return false;
        }
        Novedades other = (Novedades) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.pruebaes.entidades.Novedades[ id=" + id + " ]";
    }
    
}
